/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       imageloader.h
 * Author:     karooolek
 * Created on: 2009-05-12
 *
 **********************************************************************************************************************/

#ifndef IMAGELOADER_H_
#define IMAGELOADER_H_

#include "imagefactory.h"
#include "../common.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * Image file loader.
 * Loads images from all supported file formats.
 */
class ImageLoader : public ImageFactory, public FileLoader
{
public:
    /**
     * Load image from file.
     * @param filename image file name to load.
     * @return loaded image.
     */
    static Image *loadImageFromFile(const String &filename);

    /**
     * Create image loader with no file name specified.
     */
    ImageLoader();

    /**
     * Create image file loader with specified file name.
     * @param filename image file name to load
     */
    ImageLoader(const String &filename);

    /**
     * Destroy image file loader.
     */
    virtual ~ImageLoader();

    /**
     * Load image from file.
     */
    virtual void load();

    /**
     * Unload image.
     */
    virtual void unload();
};

}
}

#endif // IMAGELOADER_H_
